/*************************************************************
 * File: Customer.java
 * Copyright (c) 2012
 * Author: Huang Shaobin
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com 
 * Date: Feb 15, 2013
 * Description: 
 ************************************************************/

package snow.biz.selling.model;

import org.apache.commons.lang.ObjectUtils;

import snow.biz.base.model.BaseEntity;
import snow.biz.system.model.User;

/**
 * 客户信息
 * 
 * @author Shaobin.Software@gmail.com Shaobin_Software@163.com
 * @version 1.0
 */
public class Customer extends BaseEntity<Integer> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2536362344131171679L;
	
	private String code;
	private String name;

	protected Customer() {
	}

	public Customer(User createUser, String code, String name) {
		super(createUser);
		this.code = code;
		setName(name);
	}

	public boolean equals(Object obj) {
		if (obj instanceof Customer) {
			return ObjectUtils.equals(getCode(), ((Customer) obj).getCode());
		}
		return false;
	}

	public String getCode() {
		return this.code;
	}

	public String getName() {
		return this.name;
	}

	public int hashCode() {
		return ObjectUtils.hashCode(getCode());
	}

	public void setName(String name) {
		this.name = name;
	}
}
